//
//  HDButton.h
//
//  Created by HaoDong chen on 2019/4/24.
//  Copyright © 2019 chd All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger,HDButtonImagePositonType) {
    HDButtonImageLeft,
    HDButtonImageRight,
    HDButtonImageTop,
    HDButtonImageBottom,
};
@interface HDButton : UIControl
@property (nonatomic, strong, readonly) UILabel *titleL;
@property (nonatomic, strong, readonly) UIImageView *imageV;

@property (nonatomic, assign) BOOL resetCenter;
/// 点击范围, 正数代表扩大 ( 如5,5,5,5 代表上左下右均向外扩张5像素点击范围)
@property (nonatomic, assign) UIEdgeInsets expandClickInset;
/// 图片大小，不设置会自适应
@property (nonatomic, assign) CGSize imageSize;

- (void)setAttStr:(NSAttributedString * _Nullable)attStr image:(UIImage * _Nullable)image imagePositonType:(HDButtonImagePositonType)type space:(CGFloat)space;

//设置某一内容时，其他会保留原值
- (void)setAttStr:(NSAttributedString * _Nullable)attStr;
- (void)setImg:(UIImage * _Nullable)image;
- (void)setSpace:(CGFloat)space;
- (void)setPostionType:(HDButtonImagePositonType)type;
- (void)setContentInset:(UIEdgeInsets)inset;
- (CGSize)properSize;
@end

NS_ASSUME_NONNULL_END
